package lang;

/**
 * @classname:IntegerDemo
 * @description:
 * @author: Mr.Z
 * @date: 2020/12/7 19:37
 * @version: 0.1
 * @since:1.8
 */
public class IntegerDemo {
    public static void main(String[] args) {
//        demo01();
        demo02();
    }

    private static void demo02() {
        String num  = "123";
        Integer num1 = new Integer(num);
        Integer integer = Integer.valueOf(num, 10);
        int num2 = Integer.parseInt(num);
    }

    private static void demo01() {
        Integer num1 = new Integer(100);
        Integer num2 = new Integer(100);//将字符串转换成整形数据了
        Integer num3 = 100;
        Integer num4 = 100;
        Integer num5 = 170;
        Integer num6 = Integer.valueOf(100);
        System.out.println("num1==num2:"+(num1==num2));//false
        System.out.println("num2==num3:"+(num2==num3));//false
        System.out.println("num3==num4:"+(num3==num4));//true
        System.out.println("num5==num6:"+(num5==num6));//false
            int  a = num5.intValue()+2;
        System.out.println(a);

    }
}
